home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2 - Developers' Solutions / Delphi 2 Developers' Solutions.iso / dds / chap09 / howto08 / delphi10 / cciccprf.~pa < prev    next >
Encoding:
Text File  |  1996-06-12  |  3.6 KB  |  146 lines

  1. unit Cciccprf;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, TabNotBk, StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.   TCCICPrefsDlg = class(TForm)
  11.     TabbedNotebook1: TTabbedNotebook;
  12.     OKBtn: TBitBtn;
  13.     CancelBtn: TBitBtn;
  14.     HelpBtn: TBitBtn;
  15.     RadioGroup1: TRadioGroup;
  16.     RadioGroup2: TRadioGroup;
  17.     RadioGroup3: TRadioGroup;
  18.     RadioGroup4: TRadioGroup;
  19.     RadioGroup5: TRadioGroup;
  20.     RadioGroup6: TRadioGroup;
  21.     Edit1: TEdit;
  22.     Label1: TLabel;
  23.     CheckBox1: TCheckBox;
  24.     RadioGroup7: TRadioGroup;
  25.     RadioGroup8: TRadioGroup;
  26.     RadioGroup9: TRadioGroup;
  27.     RadioGroup10: TRadioGroup;
  28.     CheckBox2: TCheckBox;
  29.     RadioGroup11: TRadioGroup;
  30.     RadioGroup12: TRadioGroup;
  31.     ColorDialog1: TColorDialog;
  32.     FontDialog1: TFontDialog;
  33.     Label2: TLabel;
  34.     Button1: TButton;
  35.     Button2: TButton;
  36.     RadioGroup13: TRadioGroup;
  37.     RadioGroup14: TRadioGroup;
  38.     Bevel1: TBevel;
  39.     Label3: TLabel;
  40.     Bevel2: TBevel;
  41.     Label4: TLabel;
  42.     Edit2: TEdit;
  43.     Button3: TButton;
  44.     OpenDialog1: TOpenDialog;
  45.     Label5: TLabel;
  46.     Edit4: TEdit;
  47.     Button5: TButton;
  48.     Label6: TLabel;
  49.     RadioGroup15: TRadioGroup;
  50.     Edit3: TEdit;
  51.     Button4: TButton;
  52.     RadioGroup16: TRadioGroup;
  53.     Label7: TLabel;
  54.     Edit5: TEdit;
  55.     Label8: TLabel;
  56.     Edit6: TEdit;
  57.     Button6: TButton;
  58.     Label9: TLabel;
  59.     Edit7: TEdit;
  60.     Button7: TButton;
  61.     Label10: TLabel;
  62.     Edit8: TEdit;
  63.     Button8: TButton;
  64.     Label11: TLabel;
  65.     Edit9: TEdit;
  66.     Button9: TButton;
  67.     procedure OKBtnClick(Sender: TObject);
  68.     procedure FormShow(Sender: TObject);
  69.   private
  70.     { Private declarations }
  71.   public
  72.     { Public declarations }
  73.   end;
  74.  
  75. var
  76.   CCICPrefsDlg: TCCICPrefsDlg;
  77.  
  78. implementation
  79.  
  80. {$R *.DFM}
  81. uses CCICCFrm;
  82.  
  83. procedure TCCICPrefsDlg.OKBtnClick(Sender: TObject);
  84. begin
  85.   case Tag of
  86.     2 : begin
  87.           if CheckBox1.Checked then
  88.           begin
  89.             PasswordControlVector := 1;
  90.           end
  91.           else
  92.           begin
  93.             PassWordControlVector := 2;
  94.           end;
  95.           case RadioGroup6.ItemIndex of
  96.             0 : DefaultDownloadVector := 3;
  97.             1 : begin
  98.                   case RadioGroup5.ItemIndex of
  99.                     0 : DefaultDownloadVector := 2;
  100.                     1 : DefaultDownloadVector := 1;
  101.                   end;
  102.                 end;
  103.           end;
  104.           try
  105.             TheAnonRedialVector := StrToInt( Edit1.Text );
  106.             if TheAnonRedialVector < 1 then TheAnonRedialVector := 1;
  107.             if TheAnonRedialVector > 50 then TheAnonRedialVector := 50;
  108.           except
  109.             On EConvertError do
  110.             begin
  111.               TheAnonRedialVector := 20;
  112.             end;
  113.           end;
  114.         end;
  115.   end;
  116. end;
  117.  
  118. procedure TCCICPrefsDlg.FormShow(Sender: TObject);
  119. begin
  120.   case Tag of
  121.     2 : begin
  122.           case PasswordControlVector of
  123.             1 : CheckBox1.Checked := true;
  124.             2 : CheckBox2.Checked := false;
  125.           end;
  126.           case DefaultDownloadVector of
  127.             1 : begin
  128.                   RadioGroup5.ItemIndex := 1;
  129.                   RadioGroup6.ItemIndex := 1;
  130.                 end;
  131.             2 : begin
  132.                   RadioGroup5.ItemIndex := 0;
  133.                   RadioGroup6.ItemIndex := 1;
  134.                 end;
  135.             3 : begin
  136.                   RadioGroup5.ItemIndex := 0;
  137.                   RadioGroup6.ItemIndex := 0;
  138.                 end;
  139.           end;
  140.           Edit1.Text := IntToStr( TheAnonRedialVector );
  141.         end;
  142.   end;
  143. end;
  144.  
  145. end.
  146.